package com.yanqu.road.server.cmd.activity.soulbone;

import com.yanqu.road.message.YanQuMessage;
import com.yanqu.road.pb.activity.SoulBoneProto;
import com.yanqu.road.server.cmd.CrossCommand;
import com.yanqu.road.server.command.Cmd;
import com.yanqu.road.server.manager.activity.soulbone.CrossSoulBoneActivity;
import com.yanqu.road.server.manager.activity.soulbone.CrossSoulBoneMgr;
import com.yanqu.road.server.protocol.Protocol;

@Cmd(code = Protocol.C_SOUL_BONE_NOTICE_UPLOAD, desc = "公告上传")
public class CrossSoulBoneNoticeUploadCmd extends CrossCommand {

    @Override
    public boolean parseData(YanQuMessage packet) throws Exception {
        return true;
    }

    @Override
    public void execute(YanQuMessage packet) throws Exception {
        SoulBoneProto.SoulBoneUploadNoticeMsg noticeMsg = SoulBoneProto.SoulBoneUploadNoticeMsg.parseFrom(packet.getBytes());

        CrossSoulBoneActivity activity = CrossSoulBoneMgr.getSoulBoneActivity(noticeMsg.getActivityId());
        if(activity != null){
            activity.addDrawNotice(serverId, packet.getPlayerId(), noticeMsg.getNoticeList());
        }
    }

    @Override
    public void sendData() {

    }
}
